const server = "http://localhost:80"//服务器地址（若依默认端口80）

const customer = {//消费者相关接口
  "register": server + "/customer/register",//注册
  "login": server + "/customer/login",//登录
  "updateName": server + "/customer/updateName",//修改昵称
  "updateLocation": server + "/customer/updateLocation",//修改地址
  "updateTel": server + "/customer/updateTel",//修改电话
  "updatePassword": server + "/customer/updatePassword",//修改密码
  "queryRecord": server + "/customer/queryRecord",//添加查询记录
  "queryHistory": server + "/customer/queryHistory",//获取查询记录
  "deleteHistory": server + "/customer/deleteHistory"//删除查询记录
}

const producer = {//制造者相关接口
  "register": server + "/producer/register",//注册
  "login": server + "/producer/login",//登录
  "updateName": server + "/producer/updateName",//修改昵称
  "updateLocation": server + "/producer/updateLocation",//修改地址
  "updateTel": server + "/producer/updateTel",//修改电话
  "updatePassword": server + "/producer/updatePassword",//修改密码
  "find": server + "/producer/find"//根据id获取某个制造者的信息，用于产品溯源结果显示
}

const seller = {//销售者相关接口
  "register": server + "/seller/register",//注册
  "login": server + "/seller/login",//登录
  "updateName": server + "/seller/updateName",//修改昵称
  "updateLocation": server + "/seller/updateLocation",//修改地址
  "updateTel": server + "/seller/updateTel",//修改电话
  "updatePassword": server + "/seller/updatePassword",//修改密码
  "find": server + "/seller/find"//根据id获取某个销售者的信息，用于产品溯源结果显示
}

const transporter = {//运输者相关接口
  "register": server + "/transporter/register",//注册
  "login": server + "/transporter/login",//登录
  "updateName": server + "/transporter/updateName",//修改昵称
  "updateLocation": server + "/transporter/updateLocation",//修改地址
  "updateTel": server + "/transporter/updateTel",//修改电话
  "updatePassword": server + "/transporter/updatePassword"//修改密码
}

const upload = {//上传相关接口
  "avatar": server + "/upload/avatar",//上传头像
  "encodedImage": server + "/upload/encodedImage",//上传已编码的图片，用于消费者查询、运输者记录和销售者记录
  "productImage": server + "/upload/product"//上传产品图，用于创建新编码时上传
}

const product = {//产品相关接口
  "query": server + "/product/quickQuery",//请求对服务器上图片解码，若解码成功将查询该产品信息
  "queryById": server + "/product/queryById",//根据产品编码查询产品信息
  "addSeller": server + "/product/addSeller",//添加产品销售者记录
  "addTransportRecord": server + "/product/addTransportRecord",//添加产品运输记录
  "createCode": server + "/product/new",//创建新产品编码
  "find": server + "/product/findTransportRecord"//根据产品id查询某产品的运输记录，用于溯源结果显示
}

module.exports = {
  Customer : customer,
  Producer : producer,
  Transporter : transporter,
  Seller : seller,
  Upload : upload,
  Product : product
}